﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xfm.Core.Db;

namespace Xfm.Core.Auth
{
    public abstract class BaseUser<TRole> : BaseUser where TRole : Enum
    {
        public TRole Role { get; set; }
    }
    public abstract class BaseUser: DbBase
    {
        /// <summary>
        /// 用户名
        /// </summary>
        [Required]
        [MaxLength(50),MinLength(3)]
        public string UserName { get; set; }
        /// <summary>
        /// 加密后的密码
        /// </summary>
        [Required]
        [MaxLength(100)]
        public string Password { get; set; }
        /// <summary>
        /// 加密盐
        /// </summary>
        [Required]
        [MaxLength(50)]
        public string Solt { get; set; }
        /// <summary>
        /// 上次登录ip
        /// </summary>
        [MaxLength(50)]
        public string LastLgIp { get; set; }
        /// <summary>
        /// 上次登录时间
        /// </summary>
        public DateTime LastLgTime { get; set; }
    }
}
